﻿using G.Model.Runtime;
using G.Model;
using G.Runtime;
using GameRuntimeLibrary.Model.Runtime.Actions;

namespace G.Runtime.Actions
{
    public class ButtonAction : HasDisplayableName 
    {
        private readonly GameTaskDef _GameTask;
        private readonly GameElement _Element;
        private string _DisplayableName;

        public ButtonAction(GameElement element, GameTaskDef pGameTask)
        {
            _GameTask = pGameTask;
            _Element = element;
            _DisplayableName = "Start";
        }

        public string DisplayableName
        {
            get { return _DisplayableName; }
            set { _DisplayableName=value; }
        }

        void OnInvokeEvent(GameSpace pGame)
        {
            pGame.Globals.Events.Remove(DisplayableName);
            pGame.Elements.FireElementMoved(_Element);

//            _GameTask.FireTriggerEvent();
        }

        public override string ToString()
        {
            return _DisplayableName;
        }

    }
}
